<template>
	<view class="container" :style="{'background-color': backgroundColor}" @click="searchBoxHandler">
		<view class="my-search-box" :style="{'border-radius': borderRadius}">
			<!-- 使用uni-ui提供的图标组件库 -->
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			backgroundColor: {
				type: String,
				default: '#c00000'
			},
			borderRadius: {
				type: String,
				default: '18px'
			}
		},
		methods: {
			searchBoxHandler() {
				this.$emit('myclick')
			}
		}
	}
</script>

<style lang="scss">
	.container {
		width: 100%;
		height: 50px;
		display: flex;
		align-items: center;
		justify-content: center;
		// position: sticky;
		// top: 0;
		// left: 0;
		// z-index: 111;

		.my-search-box {
			height: 32px;
			width: 650rpx;
			background-color: #fff;
			display: flex;
			align-items: center;
			justify-content: center;

			.placeholder {
				font-size: 14px;
				margin-left: 10rpx;
			}
		}
	}
</style>
